#include<stdio.h>
#include "Queue.h"
#define true 1
#define false 0
int InitLQueue(LQueue *lq)
{
    return InitDLlist(&lq->queque);
}

void QPush(LQueue *lq, ElementType element)
{
    InsertTail(&lq->queque,element);
}

ElementType *Pop(LQueue *lq)
{
    if(lq->queque.len==0)
    {
        printf("Queue is Empty!\n");
        return NULL;
    }
    lq->FrontData=lq->queque.head->data;
    RemoveByIndex(&lq->queque,0);
    return &lq->FrontData;
}

int IsQEmpty(LQueue *lq)
{
    if(lq->queque.len==0)
    {
        return true;
    }
    else{
        return false;
    }
}

int GetQunueLen(LQueue *q)
{
    return q->queque.len;
}

struct Node *GetFront(LQueue *lq)
{
    return lq->queque.head;
}

void FreeQueue(LQueue *lq)
{
    FreeDLlist(&lq->queque);
}
